package cn.com;

import java.io.File;
import java.util.List;

import cn.com.load.ContentLoad;
import cn.com.load.UserLoad;
import cn.com.utils.FileUtil;

public class Test {
	public static void main(String[] args) {
		// 拿到保存的路径
		File input = new File("D:\\天亮教育\\大数据\\Kettle\\day_106_11.30\\data");
		File userOutput = new File(
				"D:\\天亮教育\\大数据\\Kettle\\day_106_11.30\\output\\user.txt");
		File contentOutput = new File(
				"D:\\天亮教育\\大数据\\Kettle\\day_106_11.30\\output\\content.txt");

		// System.out
		// .println(Analysis
		// .analysisToUser("User [id=1182389073, screenName=null, name=null, province=0, city=0, location=null, description=null, url=null, profileImageUrl=null, userDomain=null, gender=null, followersCount=0, friendsCount=0, statusesCount=0, favouritesCount=0, createdAt=null, following=false, verified=false, verifiedType=0, allowAllActMsg=false, allowAllComment=false, followMe=false, avatarLarge=null, onlineStatus=0, status=null, biFollowersCount=0, remark=房地产, lang=null, verifiedReason=null]"));

		List<String> files = FileUtil.getFilePathsByDir(input);
		for (String string : files) {
			// System.out.println(string);
			String[] value = string.split("\\\\");
			if ((value.length >= 10) && ("user".equals(value[8]))) {
				// System.out.println(string.split("\\\\").length);
				// System.out.println(string);
				UserLoad.loadByFile(new File(string), userOutput);
			}
			if ((value.length >= 10) && ("content".equals(value[8]))) {
				// System.out.println(string);
				ContentLoad.loadByFile(new File(string), contentOutput);
			}
		}
	}
}
